<template>
    <div>
        <el-radio-group v-model="radio1" size="medium ">
            <el-radio-button label="处理"></el-radio-button>
            <el-radio-button label="无法处理"></el-radio-button>

        </el-radio-group>
        <div style="margin-top:40px" v-if="radio1 == '处理'">
            <el-row :gutter="10">
                <el-col :span="13">
                    <div> 上传图片</div>
                </el-col>
                <el-col :span="12">
                    <el-upload-image v-model="reply_img"></el-upload-image>
                </el-col>
            </el-row>
            <el-row :gutter="10">
                <el-col :span="13">
                    <div> 备注</div>
                </el-col>
                <el-col :span="12" style="margin-top:20px">
                    <el-input type="textarea" rows="5" v-model="CLreply"></el-input>
                </el-col>
            </el-row>
            <el-row type="flex" justify="center" style="margin-top:40px">
                <el-button type="primary" icon="el-icon-check" @click="CLbtn()">完成</el-button>
            </el-row>
        </div>
        <div style="margin-top:40px" v-if="radio1 == '无法处理'">
            <el-row :gutter="10">
                <el-col :span="12">
                    <el-input type="textarea" rows="5" v-model="NoCLreply"></el-input>
                </el-col>
            </el-row>
            <el-row type="flex" justify="center" style="margin-top:40px">
                <el-button type="primary" icon="el-icon-check" @click="NoCLbtn">完成</el-button>
            </el-row>
        </div>
    </div>
</template>

<script>
import { post } from '@/assets/js/http.js'
export default {
    props: {
        rowData: {
            type: Object,
            default: () => { }
        }
    },
    data() {
        return {
            radio1: "处理",
            CLreply: "",
            NoCLreply: "",
            reply_img: '',
        }
    },
    components: {
        "el-upload-image": () => import("@/components/el-upload-image.vue")
    },
    methods: {
        //处理
        CLbtn() {
            console.log(this.reply_img, 'reply_img')
            // return
            post({
                url: "/admin/answer.Subject/handle_work",
                data: {
                    id: this.rowData.id,
                    cl_status: 1,//0中心处理1路网审核2处理完成3处理失败4处理不了提交路网
                    reply: this.CLreply,
                    reply_img: this.reply_img[0].url
                },
                loading: true,
                successTip: true
            }).finally(() => {
                this.$emit("closePopover", false)
            })
        },
        //无法处理
        NoCLbtn() {
            post({
                url: "/admin/answer.Subject/handle_work",
                data: {
                    id: this.rowData.id,
                    cl_status: 4,//0中心处理1路网审核2处理完成3处理失败4处理不了提交路网
                    reply: this.NoCLreply
                },
                loading: true,
                successTip: true
            }).finally(() => {
                this.$emit("closePopover", false)
            })
        }
    }
}
</script>

<style></style>